//console.log(process);
const path = require("path");
const fs = require("fs");
const fs2 = require("fs/promises");
//console.log(path);
const s1 = path.resolve();
console.log(s1);
const s = path.resolve('D:\\ATS\\CarreyZhou\\Desktop\\需求\\a.txt');
console.log(s);

fs.readFile(path.resolve(__dirname,'./Hello.txt'),(error,buffer)=>{
    console.log(error);
    console.log("3 " + buffer.toString());
});
//promise方式异步
fs2.readFile(path.resolve(__dirname,'./Hello.txt')).then((buf)=>{
    console.log("2 " + buf.toString());
}).catch(error => {
    console.log(error);
});
//
(async()=>{
    const buf = await fs.readFileSync(path.resolve(__dirname,'./Hello.txt'));
    console.log("1 " + buf.toString())
})();





